//
//  BindingPhone.m
//  BSS
//
//  Created by Juvi on 13-5-30.
//  Copyright (c) 2013年 juvid. All rights reserved.
//

#import "BindingPhone.h"
#import "ChangPhone.h"
#import "DetectionSystemVersion.h"
#import "UIColor+expanded.h"
#import "Common.h"
@interface BindingPhone ()

@end

@implementation BindingPhone

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if ([[DetectionSystemVersion alloc]Version]) {
        self.edgesForExtendedLayout=UIRectEdgeNone;
    }
    [self BackButton];
    self.view.backgroundColor=[UIColor colorWithHexString:@"0xe4e4e4"];
    // Do any additional setup after loading the view from its nib.
}
-(void)viewDidAppear:(BOOL)animated{
    self.labPhone.text=[Common GetPhone];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)BackButton{
    self.navigationItem.titleView=[DetectionSystemVersion SetBarTitle:@"百事搜"];
    [self.navigationItem setHidesBackButton:YES];
    UIButton *btnBack=[[DetectionSystemVersion alloc]BackButton];
    [btnBack addTarget:self action:@selector(BackReturn:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:btnBack];
    self.navigationItem.leftBarButtonItem=backItem;
    
}
#pragma mark 导航栏按钮事件
-(void)BackReturn:(id)sender{
    //    [self.navigationController.view removeFromSuperview];
    [self HidePick:self.navigationController.view];
    [self.navigationController removeFromParentViewController];
}
#pragma mark 动画
-(void)HidePick:(UIView *)vieBounced {
    [UIView animateWithDuration:0.3
                     animations:^(void) {
                         vieBounced.alpha = 0.0;
                         //                         vieBounced.frame = CGRectMake(0, self.view.frame.size.height, 104, (self.view.frame.size.height-117-8)/3);
                     } completion:^(BOOL finished) {
                         
                         [vieBounced removeFromSuperview];
                     }];
    
}
- (IBAction)btnBack:(id)sender {
    ChangPhone *changPhone=[[ChangPhone alloc]init];
    [self.navigationController pushViewController:changPhone animated:YES];
//    [self dismissViewControllerAnimated:YES completion:nil];
}
@end
